package cc.vv.lkbasecomponent.base.ui.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.loadmore.LoadMoreView;

import java.util.List;

import cc.vv.lkbasecomponent.base.ui.adapter.bean.LKBaseMultiItemEntity;
import cc.vv.lkbasecomponent.base.ui.adapter.view.LKBaseLoadMoreView;
import cc.vv.lkbasecomponent.base.ui.adapter.viewholder.LKBaseViewHolder;

/**
 * item 不同的adapter
 *
 * @author dupeng dupeng@vv.cc
 * @date 2018/3/12
 */

public class LKBaseMultiAdapter<T extends LKBaseMultiItemEntity, V extends LKBaseViewHolder> extends BaseMultiItemQuickAdapter<T, V> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public LKBaseMultiAdapter(List<T> data) {
        super(data);
        addItemTypes();
        init();
    }

    private void init() {
        this.setLoadMoreView(getCustomLoadMoreView());
    }

    /**
     * 返回自定义的加载更多控件.
     *
     * @return
     */
    protected LoadMoreView getCustomLoadMoreView() {
        return new LKBaseLoadMoreView();
    }

    /**
     * 调用 addItemType(type,id)方法。初始化type与其对应的layout
     */
    protected void addItemTypes() {
    }

    @Override
    protected void convert(V helper, T item) {
    }
}
